scale_time_hrs <- function(name = "Time (hours)", 
                           breaks = c(0, 12, 24, 48, 72),
                           limits = c(0, 72),
                           expand = c(0, 0),
                           ...) {
  # time in hours with defaults for plate reader growth curves
  scale_x_continuous(name = name, 
                     breaks = breaks,
                     limits = limits,
                     expand = expand,
                     ...)
}

scale_color_strain <- function(strain_df, ...) {
  scale_color_manual(name = "Strain",
                     breaks = strain_df$Strain_nice,
                     values = strain_df$colour,
                     ...)
}

ggplot_growthcurve <- 
  function(data_od,
           value_od = "OD595",
           limits_time = c(0, 72), 
           limits_od = c(0, 0.1),
           breaks_od = c(0, 0.05, 0.1)) {
    # basic plot defaults for growth curve 
    # e.g. 
    ggplot(data = data_od, 
           aes(x = Time, 
               y = .data[[value_od]])) + 
      scale_time_hrs(limits = limits_time) + 
      scale_y_continuous(name = "OD595",
                         limits = limits_od,
                         expand = c(0, 0),
                         breaks = breaks_od)
  }

ggplot_growthcurve_summary <- function(...) {
  ggplot_growthcurve(...) + 
  geom_line(aes(group = Well, color = Strain_nice), 
            size = 0.2, alpha = 0.2) + 
  stat_summary(aes(color = Strain_nice), 
               fun = "median", geom = "line", linewidth = 1)
}

ggplot_growthcurve_spline <- function(...) {
  ggplot_growthcurve(...) + 
  ggformula::stat_spline(aes(color = Strain_nice),
                         linewidth = 1) 
}

ggplot_growthcurve_spline_pluswells <- function(...) {
  ggplot_growthcurve(...) + 
  geom_line(aes(group = Well, color = Strain_nice), 
            size = 0.2, alpha = 0.2) + 
  ggformula::stat_spline(aes(color = Strain_nice),
                         linewidth = 1) 
}

Summary

Plate reader growth curves of GAT201 targets, March 2023

Plate 1, 20230308, for main panel figure

Design:

Set up data frame of nice strain names, colours, styles.

strain_df_1 <- tibble( 
                    Strain = c("KN99 (WT)", "GAT201", "GAT204", "LIV3", "BLP1"),
                    Strain_nice =  c("WT", "gat201∆", "gat204∆", "liv3∆", "blp1∆"),
                    colour = c("grey20", "darkred", "#d95f02", "#1b9e77",   "#7570b3"))

Read in transposed data as csv file

raw_od <-
  here::here("data", "20230308_RPMI_Gat201Targets_Plate1.xlsx") %>%
  read_platereader_xlsx(start_row = 52)

Read in the Plate map data from csv file

Also combine with nice strain names for display.

platemap <- 
  here::here("data", "20230308_RPMI_Gat201Targets_Plate1_setup.csv") %>%
  read_platemap_csv(strain_df = strain_df_1) 

head(platemap, n=10)
## # A tibble: 10 × 7
##    Well  Strain Biorep Techrep Media Strain_nice colour
##    <chr> <chr>   <dbl>   <dbl> <chr> <chr>       <chr> 
##  1 A1    <NA>       NA      NA R     <NA>        <NA>  
##  2 A2    <NA>       NA      NA R     <NA>        <NA>  
##  3 A3    <NA>       NA      NA R     <NA>        <NA>  
##  4 A4    <NA>       NA      NA R     <NA>        <NA>  
##  5 A5    <NA>       NA      NA R     <NA>        <NA>  
##  6 A6    <NA>       NA      NA R     <NA>        <NA>  
##  7 A7    <NA>       NA      NA R     <NA>        <NA>  
##  8 A8    <NA>       NA      NA R     <NA>        <NA>  
##  9 A9    <NA>       NA      NA R     <NA>        <NA>  
## 10 A10   <NA>       NA      NA R     <NA>        <NA>

Reshape data and combine with the plate map, pairing them by Well

annotated_od <- 
  reshape_annotate_raw_od(raw_od = raw_od, platemap = platemap)

Plot blank ODs

To find how stable the ODs of the blank wells are.

ggplot_growthcurve(data_od=filter(annotated_od, is.na(Strain)),
                   limits_time = c(0, 48),
                   limits_od = c(0, 0.2),
                   breaks_od = c(0, 0.05, 0.1, 0.15)) + 
  geom_line(aes(group = Well)) + 
  labs(title = "Blank wells RPMI")

This shows that the OD increases over time, presumably pH change of the phenol red indicator. We correct for this.

Plot raw ODs of all wells

ggplot_growthcurve(data_od = annotated_od,
                   limits_time = c(0, 48),
                   limits_od = c(0, 0.3),
                   breaks_od = c(0, 0.05, 0.1, 0.15, 0.2, 0.25)) +
  geom_line(aes(group = Well, colour = Strain))

Calculate median OD for blank wells

# filter out columns 1 and 12 as well?
blank_od_summary <- 
  summarise_od_fixed(annotated_od, od.name = "OD595",
                     is.na(Strain)) 

print(blank_od_summary)
## # A tibble: 1 × 4
##   OD_median OD_mean OD_max OD_min
##       <dbl>   <dbl>  <dbl>  <dbl>
## 1        NA      NA     NA     NA
blank_od_time <- 
  summarise_od_bytime(annotated_od, od.name = "OD595",
                     is.na(Strain)) 

print(blank_od_time)
## # A tibble: 284 × 5
## # Groups:   Time [284]
##     Time OD_median_time OD_mean_time OD_max_time OD_min_time
##    <dbl>          <dbl>        <dbl>       <dbl>       <dbl>
##  1 0              0.137        0.128       0.154       0.105
##  2 0.172          0.142        0.133       0.159       0.109
##  3 0.344          0.147        0.137       0.163       0.111
##  4 0.516          0.151        0.140       0.168       0.112
##  5 0.688          0.155        0.143       0.173       0.114
##  6 0.860          0.159        0.146       0.177       0.115
##  7 1.03           0.162        0.149       0.181       0.116
##  8 1.20           0.165        0.151       0.185       0.116
##  9 1.38           0.168        0.153       0.189       0.117
## 10 1.55           0.171        0.156       0.193       0.119
## # … with 274 more rows

Subtract blank OD to make corrected OD

normalised_od <- 
  normalise_od_2ways(annotated_od, is.na(Strain))

Plot OD corrected by time-based median summary

plot_plate_1 <- 
  ggplot_growthcurve_spline_pluswells(data_od = normalised_od %>%
                               filter(!is.na(Strain)),
                             value_od = "OD_corrected_time",
                             limits_time = c(0, 48),
                             limits_od = c(0, 0.11)) +
  scale_color_strain(strain_df_1)

plot_plate_1

here::here("results",
           "20230308_RPMI_Gat201Targets_Plate1_summaryplot.png") %>%
  ggsave(plot = plot_plate_1,
         width = 5, height = 3.75)

Plot OD corrected by time-based median summary, smoothed

plot_plate_1_spline <- 
  ggplot_growthcurve_spline(data_od = normalised_od %>%
                              filter(!is.na(Strain)),
                            value_od = "OD_corrected_time",
                            limits_time = c(0, 48)) +
  scale_color_strain(strain_df_1) 

plot_plate_1_spline

here::here("results",
           "20230308_RPMI_Gat201Targets_Plate1_splineplot.png") %>%
  ggsave(plot = plot_plate_1_spline,
         width = 5, height = 3.75)

Plate 2: WT, gat201∆, ecm2201∆, mep1∆, pdr802∆

strain_df_2 <- tibble( 
                    Strain = c("KN99 (WT)", "GAT201", "ECM2201", "MEP1", "PDR802"),
                    Strain_nice =  c("WT", "gat201∆", "ecm2201∆", "mep1∆", "pdr802∆"),
                    colour = c("grey20", "darkred", "#d95f02", "#1b9e77",   "#7570b3"))

platemap_2 <- 
  here::here("data", "20230310_RPMI_Gat201Targets_Plate2_setup.csv") %>%
  read_platemap_csv() 

annotated_od_2 <- 
  load_annotate_platereader(
    file_raw_od = "20230310_RPMI_Gat201Targets_Plate2.xlsx", 
    file_platemap = "20230310_RPMI_Gat201Targets_Plate2_setup.csv", 
    strain_df = strain_df_2)

ggplot_growthcurve(data_od = annotated_od_2,
                   limits_time = c(0, 48),
                   limits_od = c(0, 0.3),
                   breaks_od = c(0, 0.05, 0.1, 0.15, 0.2, 0.25)) +
  geom_line(aes(group = Well, colour = Strain))

normalised_od_2 <- annotated_od_2 %>%
  normalise_od_2ways(is.na(Strain))

Plot OD corrected by time-based median summary

plot_plate_2 <- 
  ggplot_growthcurve_spline_pluswells(data_od = normalised_od_2 %>%
                               filter(!is.na(Strain)),
                             value_od = "OD_corrected_time",
                             limits_time = c(0, 48),
                             limits_od   = c(0, 0.11)) +
  scale_color_strain(strain_df_2)

plot_plate_2

Plate 3: WT, gat201∆, CNAG_04874, hxt1∆, fcy2∆

Note, CNAG_04874 is homologous to S. pombe Crr1.

strain_df_3 <- tibble( 
                    Strain = c("KN99 (WT)", "GAT201", "CNAG_04874", "HXT1", "FCY2"),
                    Strain_nice =  c("WT", "gat201∆", "cnag_04874∆", "hxt1∆", "fcy2∆"),
                    colour = c("grey20", "darkred", "#d95f02", "#1b9e77",   "#7570b3"))

platemap_3 <- 
  here::here("data", "20230321_RPMI_Gat201Targets_Plate3_setup.csv") %>%
  read_platemap_csv() 

annotated_od_3 <- 
  load_annotate_platereader(
    file_raw_od = "20230321_RPMI_Gat201Targets_Plate3.xlsx", 
    file_platemap = "20230321_RPMI_Gat201Targets_Plate3_setup.csv", 
    strain_df = strain_df_3)

ggplot_growthcurve(data_od = annotated_od_3,
                   limits_time = c(0, 48),
                   limits_od = c(0, 0.3),
                   breaks_od = c(0, 0.05, 0.1, 0.15, 0.2, 0.25)) +
  geom_line(aes(group = Well, colour = Strain))

normalised_od_3 <- annotated_od_3 %>%
  normalise_od_2ways(is.na(Strain))

Plot OD corrected by time-based median summary

plot_plate_3 <- 
  ggplot_growthcurve_spline_pluswells(data_od = normalised_od_3 %>%
                               filter(!is.na(Strain)),
                             value_od = "OD_corrected_time",
                             limits_time = c(0, 48),
                             limits_od   = c(0, 0.11)) +
  scale_color_strain(strain_df_3)

plot_plate_3

Plate 4: WT, gat201∆, blp2∆, blp4∆, cfo1∆

strain_df_4 <- tibble( 
                    Strain = c("KN99 (WT)", "GAT201", "BLP2", "BLP4", "CFO1"),
                    Strain_nice =  c("WT", "gat201∆", "blp2∆", "blp4∆", "cfo1∆"),
                    colour = c("grey20", "darkred", "#d95f02", "#1b9e77",   "#7570b3"))

platemap_4 <- 
  here::here("data", "20230321_RPMI_Gat201Targets_Plate4_setup.csv") %>%
  read_platemap_csv() 

annotated_od_4 <- 
  load_annotate_platereader(
    file_raw_od = "20230321_RPMI_Gat201Targets_Plate4.xlsx", 
    file_platemap = "20230321_RPMI_Gat201Targets_Plate4_setup.csv", 
    strain_df = strain_df_4)

ggplot_growthcurve(data_od = annotated_od_4,
                   limits_time = c(0, 48),
                   limits_od = c(0, 0.3),
                   breaks_od = c(0, 0.05, 0.1, 0.15, 0.2, 0.25)) +
  geom_line(aes(group = Well, colour = Strain))

normalised_od_4 <- annotated_od_4 %>%
  normalise_od_2ways(is.na(Strain))

Plot OD corrected by time-based median summary

plot_plate_4 <- 
  ggplot_growthcurve_spline_pluswells(data_od = normalised_od_4 %>%
                               filter(!is.na(Strain)),
                             value_od = "OD_corrected_time",
                             limits_time = c(0, 48),
                             limits_od   = c(0, 0.11)) +
  scale_color_strain(strain_df_4)

plot_plate_4

Plate 5: WT, gat201∆, ccp1∆, cas3∆, isp6∆, cnag_05458∆

This plate included a double-copy GAT201 strain not relevant for the current figure.

strain_df_5 <- tibble( 
                    Strain = c("KN99 (WT)", "GAT201", "CAS3", "CCP1", "ISP6", "CNAG_05458", "P2.7ZH (dbl GAT201)"),
                    Strain_nice =  c("WT", "gat201∆", "cas3∆", "ccp1∆", "isp6∆", "cnag_05458∆", "dbl_GAT201"),
                    colour = c("grey20", "darkred", "#d95f02", "#1b9e77",   "#7570b3", "blue", "goldenrod"))

platemap_5 <- 
  here::here("data", "20230329_RPMI_Gat201Targets_Plate5_setup.csv") %>%
  read_platemap_csv() 

annotated_od_5 <- 
  load_annotate_platereader(
    file_raw_od = "20230329_RPMI_Gat201Targets_Plate5.xlsx", 
    file_platemap = "20230329_RPMI_Gat201Targets_Plate5_setup.csv", 
    strain_df = strain_df_5)

ggplot_growthcurve(data_od = annotated_od_5,
                   limits_time = c(0, 48),
                   limits_od = c(0, 0.25),
                   breaks_od = c(0, 0.05, 0.1, 0.15, 0.2)) +
  geom_line(aes(group = Well, colour = Strain))

normalised_od_5 <- annotated_od_5 %>%
  normalise_od_2ways(is.na(Strain)) %>%
  dplyr::filter(! Strain_nice == "dbl_GAT201")

Plot OD corrected by time-based median summary

plot_plate_5 <- 
  ggplot_growthcurve_spline_pluswells(data_od = normalised_od_5 %>%
                               filter(!is.na(Strain)),
                             value_od = "OD_corrected_time",
                             limits_time = c(0, 48),
                             limits_od   = c(0, 0.11)) +
  scale_color_strain(strain_df_5)

plot_plate_5

Plate 6: WT, gat201∆, gat201∆, ada2∆, cft1∆, cpl1∆, scw1∆

This plate also included a double-copy GAT201 strain not relevant for the current figure.

strain_df_6 <- tibble( 
                    Strain = c("KN99 (WT)", "GAT201", "ADA2", "CFT1", "CPL1", "SCW1", "P2.28EH (dbl GAT201)"),
                    Strain_nice =  c("WT", "gat201∆", "ada2∆", "cft1∆", "cpl1∆", "scw1∆", "dbl_GAT201"),
                    colour = c("grey20", "darkred", "#d95f02", "#1b9e77",   "#7570b3", "blue", "goldenrod"))

platemap_6 <- 
  here::here("data", "20230329_RPMI_Gat201Targets_Plate6_setup.csv") %>%
  read_platemap_csv() 

annotated_od_6 <- 
  load_annotate_platereader(
    file_raw_od = "20230329_RPMI_Gat201Targets_Plate6.xlsx", 
    file_platemap = "20230329_RPMI_Gat201Targets_Plate6_setup.csv", 
    strain_df = strain_df_6)

ggplot_growthcurve(data_od = annotated_od_6,
                   limits_time = c(0, 48),
                   limits_od = c(0, 0.25),
                   breaks_od = c(0, 0.05, 0.1, 0.15, 0.2)) +
  geom_line(aes(group = Well, colour = Strain))

normalised_od_6 <- annotated_od_6 %>%
  normalise_od_2ways(is.na(Strain)) %>%
  dplyr::filter(! Strain_nice == "dbl_GAT201")

In this plate the OD of many blank wells is higher than OD of wells with cells. That should not be happening. I’m going to save these plots, then move forward making a composite figure without them.

Plot OD corrected by time-based median summary

plot_plate_6 <- 
  ggplot_growthcurve_spline_pluswells(data_od = normalised_od_6 %>%
                               filter(!is.na(Strain)),
                             value_od = "OD_corrected_time",
                             limits_time = c(0, 48),
                             limits_od   = c(0, 0.11)) +
  scale_color_strain(strain_df_6)

plot_plate_6

Session info for reproducibility

sessionInfo()
## R version 4.1.1 (2021-08-10)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Big Sur 10.16
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] ggformula_0.10.4 ggridges_0.5.3   scales_1.2.0     ggstance_0.3.6  
##  [5] here_1.0.1       extrafont_0.17   readxl_1.3.1     cowplot_1.1.1   
##  [9] reshape2_1.4.4   forcats_0.5.1    stringr_1.4.0    dplyr_1.0.7     
## [13] purrr_0.3.4      readr_2.1.1      tidyr_1.1.4      tibble_3.1.6    
## [17] ggplot2_3.4.2    tidyverse_1.3.1 
## 
## loaded via a namespace (and not attached):
##  [1] httr_1.4.2         sass_0.4.1         bit64_4.0.5        vroom_1.5.7       
##  [5] jsonlite_1.7.2     modelr_0.1.8       bslib_0.3.1        assertthat_0.2.1  
##  [9] highr_0.9          cellranger_1.1.0   yaml_2.2.1         Rttf2pt1_1.3.9    
## [13] pillar_1.6.4       backports_1.4.0    glue_1.5.1         extrafontdb_1.0   
## [17] digest_0.6.29      polyclip_1.10-0    rvest_1.0.2        colorspace_2.0-2  
## [21] htmltools_0.5.2    plyr_1.8.6         pkgconfig_2.0.3    broom_0.7.10      
## [25] labelled_2.11.0    haven_2.4.3        tweenr_1.0.2       tzdb_0.2.0        
## [29] ggforce_0.3.3      generics_0.1.1     farver_2.1.0       ellipsis_0.3.2    
## [33] withr_2.5.0        cli_3.6.1          magrittr_2.0.1     crayon_1.4.2      
## [37] evaluate_0.14      fs_1.5.1           fansi_0.5.0        MASS_7.3-54       
## [41] xml2_1.3.3         tools_4.1.1        hms_1.1.1          lifecycle_1.0.3   
## [45] munsell_0.5.0      reprex_2.0.1       compiler_4.1.1     jquerylib_0.1.4   
## [49] rlang_1.1.1        grid_4.1.1         rstudioapi_0.13    mosaicCore_0.9.2.1
## [53] rmarkdown_2.14     gtable_0.3.0       DBI_1.1.1          R6_2.5.1          
## [57] lubridate_1.8.0    knitr_1.36         bit_4.0.4          fastmap_1.1.0     
## [61] utf8_1.2.2         rprojroot_2.0.2    stringi_1.7.6      parallel_4.1.1    
## [65] Rcpp_1.0.7         vctrs_0.6.2        dbplyr_2.1.1       tidyselect_1.1.1  
## [69] xfun_0.30